import { PAGE_SIZE_BASE } from '@/constants/common';
import Xhr from './axios/xhr';

const saveLightApp = data => Xhr.post('/light_app', data);
const getLightAppById = id => Xhr.get(`/light_app/${id}`);
const updateLightAppById = (id, data) => Xhr.put(`/light_app/${id}`, data);
const getLightAppList = (index = 1, size = PAGE_SIZE_BASE, keyword = '')  => Xhr.get(`/light_app/list?pageSize=${size}&pageIndex=${index}&keyword=${keyword}`);
const deleteLightAppById = id => Xhr.delete(`/light_app/${id}`);

export {
  saveLightApp,
  getLightAppById,
  updateLightAppById,
  getLightAppList,
  deleteLightAppById,
};
